package q1.project.web.jwt;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/** JWT 配置属性 */
@Component
@ConfigurationProperties(prefix = "jwt")
public class JwtProperties {

  private String secret = "your-secret-key-change-it-in-production";
  private Long accessTokenExpiration = 900000L; // 15分钟
  private Long refreshTokenExpiration = 604800000L; // 7天
  private Boolean enableIpBinding = false; // 是否启用IP绑定

  public String getSecret() {
    return secret;
  }

  public void setSecret(String secret) {
    this.secret = secret;
  }

  public Long getAccessTokenExpiration() {
    return accessTokenExpiration;
  }

  public void setAccessTokenExpiration(Long accessTokenExpiration) {
    this.accessTokenExpiration = accessTokenExpiration;
  }

  public Long getRefreshTokenExpiration() {
    return refreshTokenExpiration;
  }

  public void setRefreshTokenExpiration(Long refreshTokenExpiration) {
    this.refreshTokenExpiration = refreshTokenExpiration;
  }

  public Boolean getEnableIpBinding() {
    return enableIpBinding;
  }

  public void setEnableIpBinding(Boolean enableIpBinding) {
    this.enableIpBinding = enableIpBinding;
  }
}
